#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
template <class T> using indexed_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
#define all(a) begin(a), end(a)
#define sort(a) sort(all(a))
void setIO(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
void solve(){
int n, k, d, w;
cin >> n >> k >> d >> w;
int amt = 0;
int start = -1e9;
int left = 0;
for(int i = 0; i < n; i++){
int T;
cin >> T;
if(!left || T-start>d){
// cout << i << " opened a new packet\n";
amt++;
start = T+w;
left = k-1;
} else {
left--;
}
}
cout << amt << "\n";
}
int t;
int main(){
setIO();
cin >> t;
for(int i = 0; i < t; i++){
solve();
}
}
1721A - Image | 1180C - Valeriy and Deque |
557A - Ilya and Diplomas | 1037D - Valid BFS |
1144F - Graph Without Long Directed Paths | 1228A - Distinct Digits |
355B - Vasya and Public Transport | 1230A - Dawid and Bags of Candies |
1530A - Binary Decimal | 1472D - Even-Odd Game |
441C - Valera and Tubes | 1328E - Tree Queries |
265A - Colorful Stones (Simplified Edition) | 296A - Yaroslav and Permutations |
967B - Watering System | 152A - Marks |
1398A - Bad Triangle | 137A - Postcards and photos |
1674D - A-B-C Sort | 334A - Candy Bags |
855A - Tom Riddle's Diary | 1417A - Copy-paste |
1038A - Equality | 1061A - Coins |
1676E - Eating Queries | 1447A - Add Candies |
1721D - Maximum AND | 363C - Fixing Typos |
1401A - Distance and Axis | 658A - Bear and Reverse Radewoosh |